package com.cpi.cornpp.bushelprice.view;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * Bushel Price View
 * 
 * @author Edgar Joao
 *
 */
public class BushelPriceView implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -5222759223575963262L;
	private int bushelId;
	private String date;
	private int monthPeriodId;
	private String amount;
	private String userId;
	private String initDate;
	private String endDate;
	
	public BushelPriceView() {
		Date d = null;
		SimpleDateFormat sdf = null;
		sdf = new SimpleDateFormat("dd/MM/yyyy");
		d = Calendar.getInstance().getTime();
		this.date = sdf.format(d);
		
		//Establecemos un rango de fecha inicial y final
	    Calendar startDate = Calendar.getInstance(); 
	    Calendar endDate = Calendar.getInstance();
	    
	    startDate.set(Calendar.DATE, 1);      
	    endDate.add(Calendar.MONTH, 1);      
	    endDate.set(Calendar.DATE, 1); 
	    endDate.add(Calendar.DATE, -1);
	    
	    this.initDate = sdf.format(startDate.getTime());
	    this.endDate  = sdf.format(endDate.getTime());
	}
	
	public int getBushelId() {
		return bushelId;
	}
	public void setBushelId(int argBushelId) {
		bushelId = argBushelId;
	}
	public String getDate() {
		return date;
	}
	public void setDate(String argDate) {
		date = argDate;
	}
	public int getMonthPeriodId() {
		return monthPeriodId;
	}
	public void setMonthPeriodId(int argMonthPeriodId) {
		monthPeriodId = argMonthPeriodId;
	}
	public String getAmount() {
		return amount;
	}
	public void setAmount(String argAmount) {
		amount = argAmount;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String argUserId) {
		userId = argUserId;
	}

	public String getInitDate() {
		return initDate;
	}

	public void setInitDate(String argInitDate) {
		initDate = argInitDate;
	}

	public String getEndDate() {
		return endDate;
	}

	public void setEndDate(String argEndDate) {
		endDate = argEndDate;
	}
	
}
